package com.tedu._01mvcboot01.controller;

import com.tedu._01mvcboot01.controller.pojo.dto.VehicleDTO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class VehicleController {
    @RequestMapping("/v1/vehicle/add2")
    @ResponseBody
    public String add2(String brand, String model ,Double price){
        System.out.println("品牌："+brand+"型号："+model+"价格"+price);
        return "添加成功,品牌："+brand+"型号："+model+"价格"+price;
    }
    @RequestMapping("/v1/vehicle/add3")
    @ResponseBody
    public String add3(VehicleDTO vehicleDTO){
        String brand = vehicleDTO.getBrand();
        String model = vehicleDTO.getModel();
        Double price=vehicleDTO.getPrice();
        System.out.println("品牌："+brand+"型号："+model+"价格"+price);
        return "添加成功,品牌："+brand+"型号："+model+"价格"+price;
    }
}
